<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/WEB-INF/back/commons/head.jsp"/>
<title>商家模板</title>
<!--引用 -->
<link rel="stylesheet" type="text/css" href="/template/temp1/global.css"/>
<link rel="stylesheet" type="text/css" href="/template/temp1/style.css"/> 
<script type="text/javascript" src="/template/temp1/js/slides.jquery.js"/><!--大banner-->
<script type="text/javascript" src="/template/temp1/js/global.js"/> 
<script type="text/javascript">
<!--大banner-->
	 $(function(){
		
		$('#slides').slides({
			preload: false,
			preloadImage: '/images/loading.gif',
			effect: 'fade',
			slideSpeed: 400,
			fadeSpeed: 100,
			play: 3000,
			pause: 100,
			hoverPause: true
		});
        	$('#js-news').ticker();
			
  }); 
  
</script>
 <style>
	.index_bg01 {
		height:490px;
		background: #f4c402 repeat-x 0px 0px
	}
	.pagination li{margin:0 5px}
	.pagination li a {
		background:#fbe79a!important; border-radius:50%;height:3px; width:15px; display: block;  float: left; overflow: hidden; 
}
.pagination li.current a {
	background:#fc1b03!important; border-radius:50%;height:3px; width:15px; display: block;  float: left; overflow: hidden; 
}

	</style>
<!--引用完 -->
<script type="text/javascript">

KindEditor.ready(function (K) {
	 var editorHeader = K.create('textarea[name="header1"]', {
		   	width:'100%',
		   	height:'800px',
		   filterMode: false,//是否开启过滤模式
		   items:['source'],
		   resizeType:2,
		   themeType : 'simple',
		   wellFormatMode:true,
		   afterBlur: function(){this.sync();}//失去焦点是与html同步，让外面可以及时得到里面的数据
		   });
	 
    var editorContent = K.create('textarea[name="content1"]', {
    	width:'100%',
    	height:'800px',
    filterMode: false,//是否开启过滤模式
    items:['source'],
    resizeType:2,
    themeType : 'simple',
    wellFormatMode:true,
    afterBlur: function(){this.sync();}
    });
   
});


function showEdit(con){
	$("#editcol"+con).css("display","block"); 
}
function closeEdit(con){
	$("#editcol"+con).css("display","none"); 
}
function openwin(con){
	$('#win'+con).window('open');
	//$("#content3").css("display","block"); 
}
function save(){
	alert($("#header1").val())
	$("#header").html($("#header1").val());
	$('#win1').window('close');
}

</script>
</head>
<body>
<jsp:include page="/WEB-INF/back/commons/show_message.jsp"/>
<div class="areaTitle">
    <c:choose>  
		<c:when test="${query.search['temname']=='商家模板2'}">  
		 <a><div class="key">商家模板1</div></a>
            &nbsp;&nbsp;&nbsp; <div class="key"><font color="red">商家模板2</font></div>
		</c:when>
		<c:otherwise> 
		   <div class="key"><font color="red">商家模板1</font> </div>
             &nbsp;&nbsp;&nbsp; <a><div class="key">商家模板2</div></a>
		</c:otherwise>
	</c:choose>
   
</div>

<s:form action="list.do" method="post" modelAttribute="query">
<s:input type="hidden" path="search['temname']" name="search['temname']" />

<div class="areaContent">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="formTable">
	
	 <c:forEach var="bean" varStatus="s" items="${pageNav.list}">
	   <tr>
	     
	      <td>	
	      <div id="editcol1" style="display:none;">
	               <a onclick="openwin('1')"> 编辑</a>&nbsp;&nbsp;<a onclick="closeEdit('1')">隐藏</a>
	      </div>      
	        <div id="header" name="header" style="width: 1240px;" onclick="showEdit('1')">
                ${bean.header}
	        </div>
	      </td>   
	   <tr>
	     
	      <td>	      
	       <div id="editcol2" style="display:none;">
	               <a onclick="openwin('2')"> 编辑</a>&nbsp;&nbsp;<a onclick="closeEdit('2')">隐藏</a>
	      </div> 
	        <div id="content" name="content" style="width: 1240px;" onclick="showEdit('2')">
                ${bean.body}
	        </div>
	        <input type="button" value=" 保 存  " id="btn_banner1_update"/>          
	      </td>
	   </tr>
        
	</table>
</div>
<div id="win1" class="easyui-window" title="替换首部"
		style="width: 1240px; height: 800px;"
		data-options="iconCls:'icon-reload',tools:[
				{
					iconCls:'icon-save',
					handler:save,
				}],modal:false,closed: true,collapsible:false,shadow:false,style:{position:'fixed'}">
		<textarea name="header1" id="header1">
             ${fn:escapeXml(bean.header)}
	        </textarea>

</div>
<div id="win2" class="easyui-window" title="替换正文" style="width:1240px;height:800px"
		data-options="iconCls:'icon-reload',modal:false,closed: true,collapsible:false,shadow:false,style:{position:'fixed'}">
		<textarea name="content1">
              ${fn:escapeXml(bean.body)}
	        </textarea>

</div>
 </c:forEach>	
</s:form>

</body>
</html>
